package edu.uoc.tdp.pac3.beans;

import java.util.Date;

/**
 * Classe que representa una actuacio
 * 
 * @author Eloi Rebollo i Francesc Cabrera
 * @version 1.0
 */
public class Actuacio implements java.io.Serializable {

    private Integer idCheck;
    private Integer idRequest;
    private Integer idUser;
    private Date creationDate;
    private String description;

    public Actuacio(Integer idCheck, Integer idRequest, Integer idUser, Date creationDate, String description) {
        this.idCheck = idCheck;
        this.idRequest = idRequest;
        this.idUser = idUser;
        this.creationDate = creationDate;
        this.description = description;
        
    }
    
    public Actuacio ( Integer idRequest, Integer idUser, Date creationDate, String description){
        this.idRequest = idRequest;
        this.idUser = idUser;
        this.creationDate = creationDate;
        this.description = description;
        
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getIdCheck() {
        return idCheck;
    }

    public void setIdCheck(Integer idCheck) {
        this.idCheck = idCheck;
    }

    public Integer getIdRequest() {
        return idRequest;
    }

    public void setIdRequest(Integer idRequest) {
        this.idRequest = idRequest;
    }

    public Integer getIdUser() {
        return idUser;
    }

    public void setIdUser(Integer idUser) {
        this.idUser = idUser;
    }
  
    public boolean equals(Object obj) {
        boolean igual = false;
        if (obj != null) {
            if (obj instanceof Actuacio) {
                igual = this.getIdCheck().equals(((Actuacio) obj).getIdCheck());
            }
        }
        return igual;
    }

    @Override
    public String toString() {
        StringBuffer cadena = new StringBuffer();

        cadena.append(getIdCheck() + "\t");
        cadena.append(getIdRequest().toString() + "\t");
        cadena.append(getIdUser().toString() + "\t");        
        cadena.append(getCreationDate().toString() + "\t");
        cadena.append(getDescription() + "\t");

        return cadena.toString();
    }
}
